package cn.osworks.realtimemsg.spring;

import java.util.Map;

import org.springframework.jms.core.JmsTemplate;

import cn.osworks.aos.asset.AOSBeanLoader;
 
/**
 * <b>function:</b> Spring JMSTemplate 消息接收者
 */
public class Receiver {
 
    @SuppressWarnings("unchecked")
    public static void main(String[] args) {
    	 JmsTemplate jmsTemplate = (JmsTemplate) AOSBeanLoader.getSpringBean("jmsTemplate");   
        while(true) {  
            Map<String, Object> map =  (Map<String, Object>) jmsTemplate.receiveAndConvert();  
            System.out.println("收到消息：" + map.get("text"));  
        }  
    }
}
